﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Wordprocessing;

namespace component
{
    class generateNumbering
    {
        public static AbstractNum generateOrdered(int id, Dictionary<int, int> buffMass)
        {
            return new AbstractNum(
                 new MultiLevelType() { Val = MultiLevelValues.Multilevel },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[0] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "360", Hanging = "360" })) { LevelIndex = 0 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[1] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "792", Hanging = "432" })) { LevelIndex = 1 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[2] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1224", Hanging = "504" })) { LevelIndex = 2 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[3] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1728", Hanging = "648" })) { LevelIndex = 3 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[4] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4.%5." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2232", Hanging = "792" })) { LevelIndex = 4 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[5] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4.%5.%6." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2736", Hanging = "936" })) { LevelIndex = 5 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[6] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4.%5.%6.%7." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3240", Hanging = "1080" })) { LevelIndex = 6 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[7] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4.%5.%6.%7.%8." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3744", Hanging = "1224" })) { LevelIndex = 7 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[8] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "%1.%2.%3.%4.%5.%6.%7.%8.%9." },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "4320", Hanging = "1440" })) { LevelIndex = 8 }
                 ) { AbstractNumberId = id };
        }

        public static AbstractNum generateBullet(int id, Dictionary<int, int> buffMass)
        {
            return new AbstractNum(
                 new MultiLevelType() { Val = MultiLevelValues.HybridMultilevel },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[0] },
                     new NumberingFormat() { Val = NumberFormatValues.Bullet },
                     new LevelText() { Val = "·" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "360", Hanging = "360" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 0 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[1] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "o" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "792", Hanging = "432" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 1 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[2] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "§" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1224", Hanging = "504" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 2 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[3] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "·" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1728", Hanging = "648" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 3 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[4] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "o" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2232", Hanging = "792" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 4 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[5] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "§" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2736", Hanging = "936" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 5 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[6] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "·" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3240", Hanging = "1080" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 6 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[7] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "o" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3744", Hanging = "1224" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 7 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[8] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "§" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "4320", Hanging = "1440" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 8 }
                 ) { AbstractNumberId = id };
        }
        public static AbstractNum generateNoBullet(int id, Dictionary<int, int> buffMass)
        {
            return new AbstractNum(
                 new MultiLevelType() { Val = MultiLevelValues.HybridMultilevel },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[0] },
                     new NumberingFormat() { Val = NumberFormatValues.Bullet },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "360", Hanging = "360" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 0 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[1] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "792", Hanging = "432" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 1 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[2] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1224", Hanging = "504" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 2 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[3] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "1728", Hanging = "648" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 3 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[4] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2232", Hanging = "792" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 4 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[5] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "2736", Hanging = "936" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 5 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[6] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3240", Hanging = "1080" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 6 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[7] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = " " },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "3744", Hanging = "1224" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 7 },
                 new Level(
                     new StartNumberingValue() { Val = buffMass[8] },
                     new NumberingFormat() { Val = NumberFormatValues.Decimal },
                     new LevelText() { Val = "" },
                     new LevelJustification() { Val = LevelJustificationValues.Left },
                     new PreviousParagraphProperties(
                         new Indentation() { Left = "4320", Hanging = "1440" }),
                     new NumberingSymbolRunProperties(
                         new RunFonts() { Hint = FontTypeHintValues.Default, Ascii = "Symbol", HighAnsi = "Symbol" })) { LevelIndex = 8 }
                 ) { AbstractNumberId = id };
        }
    }
}
